from collections import deque
#会发生阻塞
def reverseWords(s):
    # s = s.strip()
    # s = s.split(" ")
    # s = s[::-1]
    # return " ".join(s)
    s = s.strip()
    s = s.split(" ")
    while "" in s:
        s.remove("")
    s = s[::-1]
    return " ".join(s)


print(reverseWords("example good a"))







